public class J1406 {
    public static void main(String[] args) {
        for(int i = 100 ;i <= 999;i++){
            int sum = 0;
            int tmp = i;
            for(int j = 1;j <= 3;j++) {
                sum += Math.pow(tmp % 10, 3);
                tmp /= 10;
            }
            if(sum == i){
                System.out.println(i);
            }
        }
    }
}

